﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="EditWorkshopA.aspx.vb" Inherits="TWIN_test.EditWorkshopA" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Edit Workshop</title>
    
</head>
<body background="../../Images/Training-Administrator-Background.gif">
<center><h1><font color = "white"> Edit Workshop</font> </h1></center>
    <form id="form1" runat="server">
    <center><div>
    
        <br />
        <br />

        <asp:DetailsView ID="DetailsView1" runat="server" 
            AutoGenerateRows="False" CellPadding="4" DataKeyNames="ID" 
            DataSourceID="SqlDataSource1" DefaultMode="Edit" ForeColor="#333333" 
            GridLines="None" Height="179px" Width="325px">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
            <EditRowStyle BackColor="#999999" />
            <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
            <Fields>
                <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                    SortExpression="ID" />
                <asp:BoundField DataField="TITLE" HeaderText="TITLE" SortExpression="TITLE" />
                <asp:BoundField DataField="INSTRUCTORID" HeaderText="INSTRUCTORID" 
                    SortExpression="INSTRUCTORID" />
                <asp:BoundField DataField="DESCRIPTION" HeaderText="DESCRIPTION" 
                    SortExpression="DESCRIPTION" />
                <asp:BoundField DataField="WORKSHOPSTART" HeaderText="WORKSHOPSTART" 
                    SortExpression="WORKSHOPSTART" />
                <asp:BoundField DataField="WORKSHOPFINISH" HeaderText="WORKSHOPFINISH" 
                    SortExpression="WORKSHOPFINISH" />
                <asp:BoundField DataField="LOCATION" HeaderText="LOCATION" 
                    SortExpression="LOCATION" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            </Fields>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        </asp:DetailsView>
        <br />
        <asp:Button ID="deleteWorkshopButton" runat="server" Text="Delete Workshop" />
        <br />


    <br />  
   
       
        <asp:Button ID="backButton" runat="server" Text="Back"/> 

   
       
    </div></center>
   
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" 
        DeleteCommand="DELETE FROM &quot;WORKSHOP&quot; WHERE &quot;ID&quot; = :original_ID AND ((&quot;TITLE&quot; = :original_TITLE) OR (&quot;TITLE&quot; IS NULL AND :original_TITLE IS NULL)) AND ((&quot;INSTRUCTORID&quot; = :original_INSTRUCTORID) OR (&quot;INSTRUCTORID&quot; IS NULL AND :original_INSTRUCTORID IS NULL)) AND ((&quot;DESCRIPTION&quot; = :original_DESCRIPTION) OR (&quot;DESCRIPTION&quot; IS NULL AND :original_DESCRIPTION IS NULL)) AND ((&quot;WORKSHOPSTART&quot; = :original_WORKSHOPSTART) OR (&quot;WORKSHOPSTART&quot; IS NULL AND :original_WORKSHOPSTART IS NULL)) AND ((&quot;WORKSHOPFINISH&quot; = :original_WORKSHOPFINISH) OR (&quot;WORKSHOPFINISH&quot; IS NULL AND :original_WORKSHOPFINISH IS NULL)) AND ((&quot;LOCATION&quot; = :original_LOCATION) OR (&quot;LOCATION&quot; IS NULL AND :original_LOCATION IS NULL))" 
        InsertCommand="INSERT INTO &quot;WORKSHOP&quot; (&quot;ID&quot;, &quot;TITLE&quot;, &quot;INSTRUCTORID&quot;, &quot;DESCRIPTION&quot;, &quot;WORKSHOPSTART&quot;, &quot;WORKSHOPFINISH&quot;, &quot;LOCATION&quot;) VALUES (:ID, :TITLE, :INSTRUCTORID, :DESCRIPTION, :WORKSHOPSTART, :WORKSHOPFINISH, :LOCATION)" 
        OldValuesParameterFormatString="original_{0}" 
        ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" 
        SelectCommand="SELECT * FROM &quot;WORKSHOP&quot; WHERE (&quot;ID&quot; = :ID)" 
        UpdateCommand="UPDATE &quot;WORKSHOP&quot; SET &quot;TITLE&quot; = :TITLE, &quot;INSTRUCTORID&quot; = :INSTRUCTORID, &quot;DESCRIPTION&quot; = :DESCRIPTION, &quot;WORKSHOPSTART&quot; = :WORKSHOPSTART, &quot;WORKSHOPFINISH&quot; = :WORKSHOPFINISH, &quot;LOCATION&quot; = :LOCATION WHERE &quot;ID&quot; = :original_ID AND ((&quot;TITLE&quot; = :original_TITLE) OR (&quot;TITLE&quot; IS NULL AND :original_TITLE IS NULL)) AND ((&quot;INSTRUCTORID&quot; = :original_INSTRUCTORID) OR (&quot;INSTRUCTORID&quot; IS NULL AND :original_INSTRUCTORID IS NULL)) AND ((&quot;DESCRIPTION&quot; = :original_DESCRIPTION) OR (&quot;DESCRIPTION&quot; IS NULL AND :original_DESCRIPTION IS NULL)) AND ((&quot;WORKSHOPSTART&quot; = :original_WORKSHOPSTART) OR (&quot;WORKSHOPSTART&quot; IS NULL AND :original_WORKSHOPSTART IS NULL)) AND ((&quot;WORKSHOPFINISH&quot; = :original_WORKSHOPFINISH) OR (&quot;WORKSHOPFINISH&quot; IS NULL AND :original_WORKSHOPFINISH IS NULL)) AND ((&quot;LOCATION&quot; = :original_LOCATION) OR (&quot;LOCATION&quot; IS NULL AND :original_LOCATION IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_ID" Type="Decimal" />
            <asp:Parameter Name="original_TITLE" Type="String" />
            <asp:Parameter Name="original_INSTRUCTORID" Type="String" />
            <asp:Parameter Name="original_DESCRIPTION" Type="String" />
            <asp:Parameter Name="original_WORKSHOPSTART" Type="DateTime" />
            <asp:Parameter Name="original_WORKSHOPFINISH" Type="DateTime" />
            <asp:Parameter Name="original_LOCATION" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="Decimal" />
            <asp:Parameter Name="TITLE" Type="String" />
            <asp:Parameter Name="INSTRUCTORID" Type="String" />
            <asp:Parameter Name="DESCRIPTION" Type="String" />
            <asp:Parameter Name="WORKSHOPSTART" Type="DateTime" />
            <asp:Parameter Name="WORKSHOPFINISH" Type="DateTime" />
            <asp:Parameter Name="LOCATION" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="ID" QueryStringField="id" 
                Type="Decimal" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="TITLE" Type="String" />
            <asp:Parameter Name="INSTRUCTORID" Type="String" />
            <asp:Parameter Name="DESCRIPTION" Type="String" />
            <asp:Parameter Name="WORKSHOPSTART" Type="DateTime" />
            <asp:Parameter Name="WORKSHOPFINISH" Type="DateTime" />
            <asp:Parameter Name="LOCATION" Type="String" />
            <asp:Parameter Name="original_ID" Type="Decimal" />
            <asp:Parameter Name="original_TITLE" Type="String" />
            <asp:Parameter Name="original_INSTRUCTORID" Type="String" />
            <asp:Parameter Name="original_DESCRIPTION" Type="String" />
            <asp:Parameter Name="original_WORKSHOPSTART" Type="DateTime" />
            <asp:Parameter Name="original_WORKSHOPFINISH" Type="DateTime" />
            <asp:Parameter Name="original_LOCATION" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>

   
   
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" 
        SelectCommand="SELECT DISTINCT * FROM &quot;WORKSHOPS_TAKEN&quot; WHERE (&quot;WORKSHOP_ID&quot; = :WORKSHOP_ID)"
        DeleteCOmmand="DELETE FROM WORKSHOPS_TAKEN WHERE &quot;WORKSHOP_ID&quot; = :id"
        >
        
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="WORKSHOP_ID" 
                QueryStringField="id" Type="Decimal" />
        </SelectParameters>
        <DeleteParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="id" 
                QueryStringField="id" Type="Decimal" />
        </DeleteParameters>
    </asp:SqlDataSource>

   
   
    </form>
</body>
</html>

